#include<iostream>
#include<fstream>
using  namespace  std;

int main()
{
    //写文件outfile.txt
    ofstream fout;
    fout.open("outfile.txt",ios::out);
    //ofstream fout("outfile.txt",ios::out);
    if(!fout)
    {
        cout<<"Can not open outfile.txt!\n";
        exit(1);
    }
    fout<<"Hello!\n";
    fout<<100<<endl;
    fout.close();

    //读文件outfile.txt
    ifstream fin("outfile.txt",ios::in);
    if(!fin)
    {
        cout<<"Can not open outfile.txt!\n";
        exit(1);
    }
    char str[80];
    int i;
    fin>>str>>i;
    cout<<str<<" "<<i<<endl;
    fin.close();
    return 0;
}